import {
	BaseUrl
} from "./config.js"

export function getUserByOpenId(openId) {
	return uni.request({
		method: "POST",
		url: BaseUrl + "/users/getByOpenID",
		data: {
			openId
		}
	}).then(res => res.data)
}

export function getUserByPhoneOpenId({
	openId,
	phone
}) {
	return uni.request({
		method: "POST",
		url: BaseUrl + "/users/createByOpenId",
		data: {
			openId,
			phone
		}
	}).then(res => res.data)
}

export function getUserByPassword({
	phone,
	password
}) {
	return uni.request({
		method: "POST",
		url: BaseUrl + "/users/getByPassword",
		data: {
			password,
			phone
		}
	}).then(res => res.data)
}